<template>
  <div class="home">
    <h1>HOME VIEW: {{ count }}</h1>
    <AboutView></AboutView>
  </div>
</template>

<script>
// @ is an alias to /src
import eventbus from '@/eventbus/bus'
import AboutView from './AboutView.vue'
export default {
  name: 'HomeView',
  data() {
    return {
      count: 0
    }
  },
  components: {
    AboutView
  },
  created() {
    console.log('created', this)
    eventbus.$on('eatHandler', v => {
      console.log('eatHandler', v)
      console.log(this)
      this.count += v
    })
  },
  destroyed() {
    eventbus.$off('eatHandler')
  }
}
</script>
